From 06c429c0f93042d01789b368597555102c70ab53 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Fri, 21 May 2010 14:02:15 +0000 Subject: [PATCH] Bug 23580. Add two new jquery events, LivePreviewPrepare and LivePreviewDone. Scripts like Navigation Popups can use this to bind to these events so they can setup their code to work with the previews. Patch by User:Amalthea --- CREDITS | 1 + RELEASE-NOTES | 2 ++ skins/common/preview.js | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/CREDITS b/CREDITS index c364add83d..2db17bf12e 100644 --- a/CREDITS +++ b/CREDITS @@ -66,6 +66,7 @@ following names for their contribution to the product. == Patch Contributors == * Agbad * Ahmad Sherif +* Amalthea * Antonio Ospite * Azliq7 * Bawolff diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 132b974d5c..2cd206d39d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -73,6 +73,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 23429) Added new hook WatchlistEditorBuildRemoveLine * (bug 18488) Added maintenance script refreshCategoryCounts.php * (bug 22844) Added support for WinCache object caching +* (bug 23580) Add two new events to LivePreview so that scripts can be + notified about the beginning and finishing of LivePreview actions === Bug fixes in 1.17 === * (bug 17560) Half-broken deletion moved image files to deletion archive diff --git a/skins/common/preview.js b/skins/common/preview.js index 7ad3df078e..d78a62b9b6 100644 --- a/skins/common/preview.js +++ b/skins/common/preview.js @@ -4,6 +4,8 @@ function doLivePreview( e ) { e.preventDefault(); + + $j( mw ).trigger( 'LivePreviewPrepare' ); var postData = $j('#editform').formToArray(); postData.push( { 'name' : 'wpPreview', 'value' : '1' } ); @@ -45,6 +47,8 @@ function doLivePreview( e ) { } ); loadSpinner.remove(); + + $j( mw ).trigger( 'LivePreviewDone', [copyElements] ); } ); } -- 2.20.1